package com.px.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.px.generate.dto.Admin;
import com.px.generate.dto.AdminExample;
import com.px.generate.mapper.AdminMapper;
import com.px.support.dao.DataAccessManager;

@Controller  
@RequestMapping("/admin")
public class AdminController {

	 @RequestMapping("/showAdmin")  
	    public String toIndex(HttpServletRequest request,Model model){  
		 	AdminExample adminExample = new AdminExample();
			adminExample.createCriteria().andUsernameEqualTo("admin");
			Admin admin = DataAccessManager.getMapper(AdminMapper.class).selectByExample(adminExample).get(0); 
	        model.addAttribute("admin", admin);  
	        return "showAdmin";  
	    }  
}
